﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class UnityReceiver : MonoBehaviour {
    public Text ShowMsg;
    public Button TestBtn;
	// Use this for initialization
	void Start () {
        TestBtn.onClick.AddListener(() =>
        {
            AndroidJavaClass androidJavaClass = new AndroidJavaClass("com.nd.unitylib.MySdk");
            AndroidJavaObject androidJavaObject = androidJavaClass.CallStatic<AndroidJavaObject>("GetInstance");
            androidJavaObject.Call("TestFunction","TestFunctionCallBack");
        });
	}


    public void OnReceiveAction(string str)
    {
        ShowMsg.text = str;
    }

    public void TestFunctionCallBack(string str)
    {
        ShowMsg.text = str;
    }
}
